package com.engr.repository.member;

import com.engr.domain.Member;
import com.engr.repository.BaseDao;
import org.springframework.data.jpa.repository.Query;

import java.util.Optional;

public interface MemberRepository extends BaseDao<Member> {

    Optional<Member> findByUsername(String username);

    @Query("SELECT m FROM Member m WHERE m.username=?1 OR m.phone=?1 OR m.email=?1")
    Optional<Member> findByUsernameOrPhoneOrEmail(String userNameOrEmailOrPhone);
}
